<template>
  <el-form-item :label="label" :required="required">
    <el-input
      :model-value="modelValue"
      @update:model-value="$emit('update:modelValue', $event)"
      :placeholder="placeholder"
      :type="type"
      :maxlength="maxlength"
    />
  </el-form-item>
</template>

<script setup lang="ts">
defineProps({
  label: { type: String, default: '输入框' },
  placeholder: { type: String, default: '请输入' },
  required: { type: Boolean, default: false },
  type: { type: String, default: 'text' },
  maxlength: { type: Number, default: 100 },
  modelValue: { type: [String, Number], default: '' }
})

defineEmits(['update:modelValue'])
</script> 